<template>
  <div class="error-collection">
    <!-- 页面头部 -->
    <div class="page-header">
      <div class="header-left">
        <el-button :icon="ArrowLeft" @click="goBack">返回</el-button>
        <h1 class="page-title">错题集</h1>
      </div>
    </div>

    <!-- 内容区域 -->
    <div class="content-section">
      <div class="collection-card">
        <div class="card-header">
          <el-icon size="48" color="#F56C6C"><Warning /></el-icon>
          <div class="header-text">
            <h2>智能错题集</h2>
            <p>AI智能分析学生错题，提供个性化学习建议和练习推荐</p>
          </div>
        </div>
        
        <div class="card-content">
          <div class="info-item">
            <span class="label">功能说明：</span>
            <span class="value">收集和分析学生的错题，提供智能复习建议</span>
          </div>
          <div class="info-item">
            <span class="label">AI分析：</span>
            <span class="value">自动识别错题类型，生成相似题目练习</span>
          </div>
          <div class="info-item">
            <span class="label">开发状态：</span>
            <span class="value status-pending">待开发</span>
          </div>
          <div class="info-item">
            <span class="label">任务ID：</span>
            <span class="value">{{ taskId }}</span>
          </div>
        </div>

        <!-- 功能预览 -->
        <div class="feature-preview">
          <h3>主要功能</h3>
          <div class="feature-list">
            <div class="feature-item">
              <el-icon color="#67C23A"><Check /></el-icon>
              <span>错题自动收集</span>
            </div>
            <div class="feature-item">
              <el-icon color="#67C23A"><Check /></el-icon>
              <span>AI智能分析</span>
            </div>
            <div class="feature-item">
              <el-icon color="#67C23A"><Check /></el-icon>
              <span>相似题目推荐</span>
            </div>
            <div class="feature-item">
              <el-icon color="#67C23A"><Check /></el-icon>
              <span>学习进度跟踪</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter, useRoute } from 'vue-router'
import { ArrowLeft, Warning, Check } from '@element-plus/icons-vue'

const router = useRouter()
const route = useRoute()

// 获取任务ID
const taskId = route.params.taskId || '未指定'

const goBack = () => {
  router.go(-1)
}
</script>

<style scoped>
.error-collection {
  padding: 24px;
  background: #f5f7fa;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: #303133;
  margin: 0;
}

.content-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.collection-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 700px;
  width: 100%;
  text-align: center;
}

.card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.header-text h2 {
  font-size: 20px;
  font-weight: 600;
  color: #303133;
  margin: 0 0 8px 0;
}

.header-text p {
  font-size: 14px;
  color: #606266;
  margin: 0;
  line-height: 1.5;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  margin-bottom: 32px;
}

.info-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
}

.label {
  font-size: 14px;
  font-weight: 600;
  color: #606266;
  min-width: 100px;
  flex-shrink: 0;
}

.value {
  font-size: 14px;
  color: #303133;
  flex: 1;
}

.status-pending {
  color: #E6A23C;
  font-weight: 600;
}

.feature-preview {
  text-align: left;
}

.feature-preview h3 {
  font-size: 16px;
  font-weight: 600;
  color: #303133;
  margin: 0 0 16px 0;
  text-align: center;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f0f9ff;
  border-radius: 6px;
  border: 1px solid #e1f5fe;
}

.feature-item span {
  font-size: 14px;
  color: #303133;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .error-collection {
    padding: 16px;
  }
  
  .collection-card {
    padding: 24px;
  }
  
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .feature-list {
    grid-template-columns: 1fr;
  }
}
</style>